from rest_framework import serializers
from .models import *


class CateSer(serializers.ModelSerializer):
    class Meta:
        model = Cate
        fields = '__all__'


class GoodsSer(serializers.ModelSerializer):
    class Meta:
        model = Goods
        fields = '__all__'

class GoodsLisrSer(serializers.ModelSerializer):
    cate = serializers.CharField(source='cate.name')
    class Meta:
        model = Goods
        fields = '__all__'